<?php  

class m_sppd_kota extends CI_Controller {
 
	var $limit=10;
	var $offset=10;	
	
	function index($limit='',$offset=''){
		$this->load->model("init"); 
		$this->init->getLasturl();
		if($this->session->userdata('LOGIN')=='TRUE'){
		$this->load->model("m_sppd_kota_model"); 
		$data['judul']='Master Kota';
		$data['query']=$this->m_sppd_kota_model->getListKota();
 		$data['view']='m_sppd_kota/hist_sppd';
		$this->load->view('index',$data);
		}else {
		redirect('home/loginPage');		
		}

	}
	function search($limit='',$offset=''){
	 	$this->load->model("m_sppd_kota_model"); 
		 
 
		$data['query']=$this->m_sppd_kota_model->getListKota();
		$this->load->view('m_sppd_kota/data',$data);
	}
	
	function add($id=''){	
		$this->load->model("m_sppd_kota_model"); 
		 $getKota=$this->m_sppd_kota_model->getKota($id);
		 $table="";
		 $table.="<form id='frmsave' name='frmsave'><table>";
		 $table.="<tr>";
		 $table.="<td>Nama Kota</td>";
		 $table.="<td>:</td>";
		 $table.="<td><input type='text' name='txtkota' id='txtkota' value='".$getKota."'></td>";
		 $table.="</tr>";
		 $table.="</table></form>";
		echo $table;
	}
  
	function simpan($id=''){
		$this->load->model("m_sppd_kota_model"); 
		$this->m_sppd_kota_model->simpan($id);
	}
	 
	 
	function deleteKota($id=''){
		$this->db->query("delete from m_kota where id='$id'");
	}
	
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */